import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid, systemid } from '../../atom/config';

interface Message {
	filter: {
		project_nos: string[];
	};
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}



export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const p = query(action_id, session_id, systemid);
	p.prepare('company_project', ['equip_depart_no', 'equip_depart_name', 'project_manager', 'project_no'], { productid, project_no: { $in: message.filter.project_nos } }, 20, 1, [], []);
	const [dt] = await p.exec();
	return { dt };
}
